import { MockMethod } from 'vite-plugin-mock';
import { resultSuccess } from '../_util';
import { mock } from 'mockjs';

const serviceList = mock({
  'data|30': [
    {
      serviceId: '@increment',
      serviceName: '@ctitle(6)',
      sort: '@integer(0,2)',
      createTime: '@date(yyyy-MM-dd HH:mm:ss)',
    },
  ],
});

export default [
  {
    url: '/mock-api/v1/goods/service/page',
    method: 'post',
    response: () => {
      return resultSuccess({ list: serviceList.data.slice(0, 6), total: 6 });
    },
  },
  {
    url: '/mock-api/v1/goods/service/list',
    method: 'post',
    response: () => {
      return resultSuccess(serviceList.data.slice(0, 6));
    },
  },
] as MockMethod[];
